package se.perp.c4.control;

import se.perp.c4.control.iface.IMessenger;
import se.perp.c4.control.iface.IShadowfaxListener;
import se.perp.c4.control.iface.ISpecialCardListener;
import se.perp.c4.net.Message;
import se.perp.c4.ui.SpecialCard;

class ShadowfaxHandler implements ISpecialCardListener {

    private final IMessenger conn;
    private final IShadowfaxListener listener;

    public ShadowfaxHandler(final IMessenger conn, final IShadowfaxListener listener) {
        this.conn = conn;
        this.listener = listener;
    }

    public void cardClicked(SpecialCard c) {
        listener.shadowfaxPlayed();
        c.setEnabled(false);

        conn.sendMessage(Message.newShadowfaxPlayed());
    }
}
